//
//  ZLDefine.h
//  ZCLive
//
//  Created by 彭军 on 2017/11/14.
//  Copyright © 2017年 Elvis. All rights reserved.
//

#ifndef ZLDefine_h
#define ZLDefine_h

#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

//1.获取屏幕宽度与高度
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREENH_HEIGHT [UIScreen mainScreen].bounds.size.height
#define SCREEN_SIZE [UIScreen mainScreen].bounds.size

#define NativeScale [UIScreen mainScreen].nativeScale
#define NativeBounds [UIScreen mainScreen].nativeBounds

#define SCREEN_SCALE NativeBounds.size.width / 750.0

#define CCGetRealFromPt(x) (x / NativeScale) * SCREEN_SCALE

#define CCGetPxFromPt(x) (x / NativeScale)

#define MainColor [UIColor colorWithRed:242/255.0 green:124/255.0 blue:25/255.0 alpha:1.0]
#define StreamColor [UIColor colorWithRed:34/255.0 green:35/255.0 blue:37/255.0 alpha:1.0]

#define NLColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define NLRGB(r, g, b) [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) / 255.0) alpha:1.0]

#define LIVE_USERID @"Live_UserId"
#define LIVE_ROOMID @"Live_RoomId"
#define LIVE_ROLE   @"LIVE_ROLE"
#define LIVE_USERNAME @"Live_UserName"
#define LIVE_PASSWORD @"Live_Password"

#define SaveToUserDefaults(key,value) [[NSUserDefaults standardUserDefaults] setObject:value forKey:key]

#endif /* ZLDefine_h */
